package com.example.ordersys.controller;

import com.example.ordersys.mapper.OrderDetailMapper;
import com.example.ordersys.model.OrderDetail;
import com.example.ordersys.tools.ResponseBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.*;

@RestController
@RequestMapping("/detail")
public class OrderDetailController {

    @Resource
    private OrderDetailMapper orderDetailMapper;

    @RequestMapping("/list")
    public ResponseBody<List<OrderDetail>> getList(int oid){
        int status=-1;
        String message="获取订单详情失败";

        List<OrderDetail> data = null;
        if ((data=orderDetailMapper.getList(oid))!=null){
            status=0;
            message="";
        }
        return new ResponseBody<>(status,message,data);
    }

}